import request from '@/utils/request'
// 已收藏的房源
export function favoriates () {
  return request({
    url: '/user/favorites'
  })
}
// 已经发布的房源
export function publishedhouse () {
  return request({
    url: '/user/houses'
  })
}
// 发布房屋所需要的条件
export function houseneedcondition () {
  return request({
    url: '/houses/params'
  })
}

// 用户发布房源

export function userpublishhouse (data) {
  return request({
    url: '/user/houses',
    method: 'post',
    data
  })
}

// 上传图片
export function uploadpicture (data) {
  return request({
    url: '/houses/image',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    method: 'post',
    data
  })
}
// 我的喜欢
export function getfavoritehouse (id) {
  return request({
    url: '/user/favorites/' + id
  })
}
// 获取房屋详情
export function gethousedetail (id) {
  return request({
    url: '/houses/' + id
  })
}
// t添加收藏
export function addhouselike (id) {
  return request({
    url: '/user/favorites/' + id,
    method: 'post'
  })
}
// 删除收藏
export function deletehouselike (id) {
  return request({
    url: '/user/favorites/' + id,
    method: 'delete'
  })
}

// 我的喜欢列表
export function myhouselike () {
  return request({
    url: '/user/favorites',
    method: 'get'
  })
}
